<?php
/**
 * 一款轻博客样式的风格，起名为Dolphin，意为海豚，希望如海豚般优秀，亲和，受人喜欢。
 *
 * @package 简之美(Dolphin)
 * @author 方寸阳光
 * @version 2.1(The End)
 * @link http://ysido.com
 * @time 2013-10-23
 */
 if (isset($_GET["action"]) && $_GET["action"] == "ajax" && Helper::options()->PageType == 1){ 
	while($this->next()): ?>
		<section class="post page1">
			<div class="title"><h2><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
				<p>
					<span class="meta-time"><?php $this->date('Y-m-d H:i:s'); ?></span><span class="meta-cat"><?php $this->category('、'); ?></span><span class="meta-comm"><a href="<?php $this->permalink() ?>#comments" class="CommentsNumber"><?php $this->commentsNum('抢沙发', '1条评论', '%d条评论'); ?></a></span>
				</p>
			</div>
			<div class="content"><?php $this->content('阅读全文'); ?></div>
			<div class="meta-tag"><?php _e('标签：'); ?><?php $this->tags('，'); ?></div>
		</section>
        <div class="clear"></div>
<?php endwhile;
}else{
 if(strpos($_SERVER["PHP_SELF"],"themes")){header('Location:/');}
 $this->need('header.php');
?>
<article id="main">
	<div id="top"></div>
	<div id="content">	
	<?php while($this->next()): ?>
		<section class="post page1">
			<div class="title"><h2><a href="<?php $this->permalink() ?>"><?php $this->title() ?></a></h2>
				<p>
					<span class="meta-time"><?php $this->date('Y-m-d H:i:s'); ?></span><span class="meta-cat"><?php $this->category('、'); ?></span><span class="meta-comm"><a href="<?php $this->permalink() ?>#comments" class="CommentsNumber"><?php $this->commentsNum('抢沙发', '1条评论', '%d条评论'); ?></a></span>
				</p>
			</div>
			<div class="content"><?php $this->content('阅读全文'); ?></div>
			<div class="meta-tag"><?php _e('标签：'); ?><?php $this->tags('，'); ?></div>
		</section>
        <div class="clear"></div>
	<?php endwhile; ?>
    <div class="clear"></div>
	</div>	
	<div id="pagenavi" class="pages">
		<span id="hidenavi"><?php $this->pageNav(); ?></span>
		<?php if (Helper::options()->PageType): ?>
			<span><a href="#;">Next Page >></a></span>
			<script type="text/javascript">//无缝载入
				$('#hidenavi').hide();
				$(function(){
					var $Id = 2;
					var all = parseInt($('#pagenavi li a:not(.next):last').text()) + 1; //获取总页数
					var Html = $('#content');
					var Load = $('#pagenavi');
					var state = $('.next');
					var path = $('.page-navigator a.next').attr('href');
					path = path.indexOf('index.php')?('index.php/page/'):('page/');
					if ($Id == all){Load.html('');}
					$('#pagenavi a').live('click',function(){
						var Up = $(this).offset().top - 70 ;
						$.ajax({
							url: '<?php $this->options->siteUrl(); ?>'+ path + $Id +'/?action=ajax',
							dataType: "text",
							beforeSend: function(){Load.html('努力加载中，请稍等……');Load.css("font-size","30px");},
							success:function(a){
								$('html,body').animate({scrollTop: Up},800);
								Html.append(a);
								if($Id < all){
									Load.html('<a href="#;">Next Page >></a>');
								}else{
									Load.html('');				
								}
								ImgChange(); //再次调用图片渐显
								ArtLoading(); //加载标题转换
								PageLoder(); //页面延迟加载
							}
						});
				$Id++;
				return false;
			});
		});
</script>
		<?php endif; ?>
	</div>
    <div class="clear"></div>	
	<?php $this->need('sidebar.php'); ?>
	<div id="bottom"></div>	
	</article><!-- content END -->
	<?php $this->need('footer.php'); ?>
<?php } ?>